<template>
  <div>
    <van-nav-bar title="商品搜索" left-arrow @click-left="$router.push('/homepage')" />
    <van-search
    v-model="value"
     show-action placeholder="请输入您搜索的商品">
      <template #action>
        <div @click="onSearch" class="box">搜索</div>
      </template>
    </van-search>
  </div>
</template>

<script>
export default {
  name: 'SearchView',
  data () {
    return {
      value: ''
    }
  },
  methods: {
    onSearch () {
      // console.log(132)
      this.$router.push('/detail')
    }
  }
}
</script>

<style lang="less" scoped>
/deep/.van-nav-bar .van-icon {
  color: #000;
}

/deep/ .van-nav-bar__arrow {
  font-size: 20px;
}

/deep/.van-search {
  background: #f1f1f2;
}

/deep/.van-search__content {
  background: #fff;
}

.box {
  width: 80px;
  height: 33px;
  background: red;
  color: #fff;
  text-align: center;
  // margin-right: 50px;
}

/deep/.van-search__action {
  padding: 0;
}
</style>
